home *** CD-ROM | disk | FTP | other *** search
- PROGRAM MACHINE_ID
- integer*4 laddr/#FFFF000E/
- integer*2 ibyte
- c
- c This program is a demonstration of an all-Fortran PEEK routine.
- c It will return the machine ID byte from address FFFF:000E;
- c this location tells you whether your machine is a PC, an XT,
- c or an AT.
- c
- c Ignore the error message F2607 that is emitted by the Microsoft
- c compiler - we're simply doing something that they don't understand.
- c If it bothers you, then complile PEEKB0 apart from the rest of the
- c code, and then link it in.
- c
- call peekb(laddr,ibyte)
- print 20, ibyte
- 20 format (' ibyte = ',z2)
- c
- stop
- end
- INTERFACE TO SUBROUTINE PEEKB0(L,I)
- integer*4 L [VALUE]
- end
- SUBROUTINE PEEKB(LADDR,IBYTE)
- integer*4 laddr ! Address of byte to get
- integer*2 ibyte ! Value of that location
- call peekb0(laddr,ibyte) ! Pass LADDR by value
- ibyte=iand(ibyte,255) ! Trim off extra byte
- return
- end
- SUBROUTINE PEEKB0(I,IBYTE)
- integer*2 i,ibyte
- ibyte=i ! Get what's there
- return
- end
-